import apis from "./api"; // 引入局部的数据模拟文件
import { Random, setup, mock } from "mockjs";

setup({
	timeout: "200-300",
});

//#endregion
Random.extend({
	id: function () {
		return this.natural(1, 10000);
	},
	image: function () {
		return `https://cdn.seovx.com/img/mom20-1%20(${this.natural(1, 100)}).jpg`;
	},
});

const baseUrl = "/mockapi/";
const mocks = [...apis];

mocks.map((e) => {
	mock(new RegExp(baseUrl + e.url), e.method, e.data);
});
